package com.ly.heart.service.impl;

import java.util.List;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import com.ly.common.utils.DateUtils;
import com.ly.common.utils.SecurityUtils;
import com.ly.common.utils.erp.SnowflakeIdWorker;
import com.ly.heart.mapper.KingBaseMeteringUnitGroupMapper;
import com.ly.heart.service.IKingBaseMeteringUnitGroupService;
import org.springframework.stereotype.Service;
import com.ly.heart.domain.KingBaseMeteringUnitGroupEntity;

import javax.annotation.Resource;

/**
 * 金蝶-基础-计量单位组Service业务层处理
 *
 * @author cxl
 * @date 2024-07-01
 */
@Service
public class KingBaseMeteringUnitGroupServiceImpl extends ServiceImpl<KingBaseMeteringUnitGroupMapper, KingBaseMeteringUnitGroupEntity> implements IKingBaseMeteringUnitGroupService {

    @Resource
    private KingBaseMeteringUnitGroupMapper kingBaseMeteringUnitGroupMapper;

    /**
     * 查询金蝶-基础-计量单位组
     *
     * @param id 金蝶-基础-计量单位组ID
     * @return 金蝶-基础-计量单位组
     */
    @Override
    public KingBaseMeteringUnitGroupEntity selectKingBaseMeteringUnitGroupEntityById ( String id ) {
        return kingBaseMeteringUnitGroupMapper.selectKingBaseMeteringUnitGroupEntityById ( id );
    }

    /**
     * 查询金蝶-基础-计量单位组列表
     *
     * @param kingBaseMeteringUnitGroupEntity 金蝶-基础-计量单位组
     * @return 金蝶-基础-计量单位组
     */
    @Override
    public List<KingBaseMeteringUnitGroupEntity> selectKingBaseMeteringUnitGroupEntityList ( KingBaseMeteringUnitGroupEntity kingBaseMeteringUnitGroupEntity ) {
        return kingBaseMeteringUnitGroupMapper.selectKingBaseMeteringUnitGroupEntityList ( kingBaseMeteringUnitGroupEntity );
    }

    /**
     * 新增金蝶-基础-计量单位组
     *
     * @param kingBaseMeteringUnitGroupEntity 金蝶-基础-计量单位组
     * @return 结果
     */
    @Override
    public int insertKingBaseMeteringUnitGroupEntity ( KingBaseMeteringUnitGroupEntity kingBaseMeteringUnitGroupEntity ) {
        kingBaseMeteringUnitGroupEntity.setId ( SnowflakeIdWorker.getInstance ().nextStringId () );
        kingBaseMeteringUnitGroupEntity.setUserId ( SecurityUtils.getLoginUser ().getUser ().getUserId () );
        kingBaseMeteringUnitGroupEntity.setCreateTime ( DateUtils.getNowDate () );
        return kingBaseMeteringUnitGroupMapper.insertKingBaseMeteringUnitGroupEntity ( kingBaseMeteringUnitGroupEntity );
    }

    /**
     * 修改金蝶-基础-计量单位组
     *
     * @param kingBaseMeteringUnitGroupEntity 金蝶-基础-计量单位组
     * @return 结果
     */
    @Override
    public int updateKingBaseMeteringUnitGroupEntity ( KingBaseMeteringUnitGroupEntity kingBaseMeteringUnitGroupEntity ) {
        return kingBaseMeteringUnitGroupMapper.updateKingBaseMeteringUnitGroupEntity ( kingBaseMeteringUnitGroupEntity );
    }

    /**
     * 批量删除金蝶-基础-计量单位组
     *
     * @param ids 需要删除的金蝶-基础-计量单位组ID
     * @return 结果
     */
    @Override
    public int deleteKingBaseMeteringUnitGroupEntityByIds ( String[] ids ) {
        return kingBaseMeteringUnitGroupMapper.deleteKingBaseMeteringUnitGroupEntityByIds ( ids );
    }

    /**
     * 删除金蝶-基础-计量单位组信息
     *
     * @param id 金蝶-基础-计量单位组ID
     * @return 结果
     */
    @Override
    public int deleteKingBaseMeteringUnitGroupEntityById ( String id ) {
        return kingBaseMeteringUnitGroupMapper.deleteKingBaseMeteringUnitGroupEntityById ( id );
    }
}
